import java.util.*;
public class Lab09Task02 {
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
System.out.print("Enter the size: ");
int array_size=kb.nextInt(),min_index=0,max_index=0;
double[] double_array= new double[array_size];
double max,min;
System.out.printf("Enter element at index# 0 of the array: ");
double_array[0]=kb.nextDouble();
max=double_array[0];
min=double_array[0];
for(int i=1;i<double_array.length;i++) {
System.out.printf("Enter element at index# %d of the array: ",i);
double_array[i]=kb.nextDouble();
if(double_array[i]>max) {
max=double_array[i];
max_index=i;}
else if(double_array[i]<min) {
min=double_array[i];
min_index=i;}
}
System.out.printf("%nMax value = %.2f, its first occurrence is at index# %d%nMin value = %.2f, its first occurrence is at index# %d",max,max_index,min,min_index);
kb.close();
}
}